[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
twDbPick( cAlias, cField, cColHead, nTop, nLeft, wColor,;
wSType, wFType, wFColor, bReturn, lSound )
----------------------------------------------------------------------------
Displays a pick list on an open database. You must pass the work
area alias and the field name. A later version might allow a code
block to ne passed, to allow the viewing of more than one field.
The box is centered on the screen by default, or you can define
where it goes. If the size is out of bounds, the box is truncated.
Scrollbars are automatically added.
The TBrowse processes the following keys:
Up Arrow ---------+
Down Arrow |
Left Arrow |
Right Arrow |
Page Down |- Scroll the Highlight Bar in
Page Up | the normal way.
Ctrl Page Down |
Ctrl Page Up |
Ctrl Left Arrow |
Ctrl Right Arrow |
Ctrl Home |
Ctrl End ---------+
Escape - Exit with no choice.
Enter - Exit with choice.
Alt U - Move box up one space.
Alt N - Move box down one space.
Alt H - Move box left one space.
Alt J - Move box right one space.
Alpha Keys - Speed Search with display of key.
Arguments:
cAlias - 'C' OPEN database alias
cField - 'C' Fieldname to display
cColHead - 'C' Header for column. Defaults to 'Select Item'
nTop - 'N' Top line for display. Defaults to center the box.
nLeft - 'N' Left column for display. Defaults to center the
box.
wColor - 'C' Clipper color string or three element array for
colors as follows: The defaults are shown.
wColor = Window Colour Clipper Standard
tColor = Title Colour Reverse Standard Colour
sColor = ScrollBar Colour Clipper Standard
wSType - 'N' Window shadow type. (See Quick Reference)
wFType - 'N' Window frame type. (See Quick Reference)
wFColor - 'C or A' TSDWIN frame colour.
bReturn - 'B' Return. Defaults to RECNO(). Pass by Reference.
lSound - 'L' Logical for sound at hitbottom and hittop.
Return:
Defaults to RECNO() but is definable.
Example:
// Open Database
USE windemo INDEX windemo.ntx ALIAS codes NEW
SELECT codes
TryGet1 := SPACE( LEN( codes->codekey ))
TryGet2 := SPACE (LEN( codes->codeShort: ))
SETCOLOR( "w+/b,gr+/r,,,n/w" )
CLS
@ 0,0,24,79 BOX "#########"
@05,10 SAY "Getting.." GET TryGet1 PICTURE "@X" WHEN ;
CheckList( "codes", "codekey", "Key;Value" )
@06,10 SAY "Next One " GET TryGet2 PICTURE "@X" WHEN ;
CheckList( "codes", "codeShort:", "Code;Decsription" )
READMODAL( getlist )
getlist := {}
//***************************
// Executes in the WHEN condition
FUNCTION CheckList( In_Alias, In_Field, ColHead )
LOCAL bColor := { "w+/g,gr+/br", "n/w" }
LOCAL SelField, TcRecord1 := RECNO()
LOCAL TcSelect := SELECT()
LOCAL TcRecord2, t
t := twDBPick( In_Alias, In_Field,;
ColHead, 2, 45, bColor, 1, 9 )
IF t <> NIL
SELECT &In_Alias; TcRecord2 := RECNO(); GOTO t
SelField := In_Alias + "->" + In_Field
KEYBOARD &SelField
GO TcRecord2
SELECT( TcSelect ); GO TcRecord1
RETURN .T.
ELSEIF LASTKEY() == K_PGDN
RETURN .T.
ELSE
RETURN .F.
ENDIF
See Also:
twARPick()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson